package com.hesicare.health.mapper;

import com.hesicare.health.entity.SysUserDept;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface SysUserDeptMapper {

    /**
     * 通过员工ID删除员工和部门关联
     *
     * @param userId 员工ID
     * @return 结果
     */
    public int deleteUserDeptByUserId(@Param("userId") Long userId);


    /**
     * 查询部门使用数量
     *
     * @param deptId 部门ID
     * @return 结果
     */
    public int selectCountUserDeptByDeptId(Long deptId);

    /**
     * 批量新增员工部门信息
     *
     * @param userDeptList 员工部门列表
     * @return 结果
     */
    public int batchUserDept(List<SysUserDept> userDeptList);

    /**
     * 根据员工ID查询部门ID
     *
     * @param userId 员工ID
     * @return 结果
     */
    public List<Long> selectDeptIdByUserId(Long userId);

    public void inserUserDept(@Param("sysUserDept") SysUserDept sysUserDept);

    public SysUserDept selectBySysUserDept(SysUserDept sysUserDept);

}
